package old.day04;
import java.util.Scanner;
public class Day04Exercise {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int num =(int) (Math.random()*1000+1);
        System.out.println(num);
        int guess;
        do {
            System.out.println("猜吧");
            guess=scan.nextInt();
            if (guess>num){
                System.out.println("太大了");
            }else if (guess<num){
                System.out.println("太小了");
            }else {
                System.out.println("恭喜你猜对了");
            }
        }while (guess!=num);




















        /*
        Scanner scan=new Scanner(System.in);
        int num=(int) (Math.random()*1000+1);
        System.out.println(num);
        System.out.println("猜吧");
        int guess=scan.nextInt();
        while (guess!=num){
            if (guess>num){
                System.out.println("太大了");
            }else{
                System.out.println("太小了");
            }
            System.out.println("请重新猜");
            guess=scan.nextInt();
        }
        System.out.println("恭喜你，猜对了");

         */



















        /*
        Scanner scan=new Scanner(System.in);
        System.out.println("请选择功能：1.存款2.取款3.查询余额4.退卡");
        int command= scan.nextInt();
        switch (command){
            case 1:System.out.println("存款操作");
            break;
            case 2:System.out.println("取款操作");
            break;
            case 3:System.out.println("查询余额");
            break;
            case 4:System.out.println("退卡操作");
            break;
            default:System.out.println("输入格式错误");
        }

         */





















        /*
       Scanner scan=new Scanner(System.in);
        System.out.println("请输入成绩：");
       double num =scan.nextDouble();
       if (num>100&&num<0){
           System.out.println("输入不合法");
       }else if (num>=90){
           System.out.println("优秀");
       }else if (num>=80){
           System.out.println("良好");
       }else if (num>=60){
           System.out.println("及格");
       }else {
           System.out.println("不及格");
       }

         */


    }
}
